package com.kalix.ynpetroleum.storage.biz;

import com.kalix.framework.core.util.ConfigUtil;
import com.kalix.ynpetroleum.storage.api.biz.IStorageBeanService;
import com.kalix.ynpetroleum.storage.api.dao.IStorageBeanDao;
import com.kalix.ynpetroleum.storage.api.model.HttpRequestUtil;
import com.kalix.ynpetroleum.storage.api.model.PostRequestUtil;
import com.kalix.ynpetroleum.storage.entities.StorageBean;
import com.kalix.framework.core.impl.biz.GenericBizServiceImpl;

/**
 *@ Author  ZhaoHang
 * @Date  2019/11/18
 **/
public class StorageBeanServiceImpl extends GenericBizServiceImpl<IStorageBeanDao, StorageBean> implements IStorageBeanService {
    public static String wsIp = (String) ConfigUtil.getConfigProp("FREEBOARD_IP","config.ynpetroleum.portconf");
    public static String wsPort =(String)ConfigUtil.getConfigProp("FREEBOARD_PORT","config.ynpetroleum.portconf");
    @Override
    public String getValue() {
        String body = "[{" +
                "\"moType\": \"EMC_ISILON\"," +
                "\"uuid\": \"0860000d\"," +
                "\"metricName\": \"SpaceUsedRate\"" +
                "}，{\n" +
                "\"moType\": \"EMC_ISILON\"," +
                "\"uuid\": \"0860000d\"," +
                "\"metricName\": \"ClusterHealthStatus\"" +
                "}]";
        String getAll = PostRequestUtil.HttpPostWithJson("http://"+wsIp+":"+wsPort+"/api/v1/mo/metrics",body);
        return null;
    }
}
